<%--
  Created by IntelliJ IDEA.
  User: 陈锋
  Date: 2023/6/8
  Time: 16:53
  To change this template use File | Settings | File Templates.
  定期转活期
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--定期转活期--%>
<html>
<head>
    <title>Title</title>
    <script src="../static/script/jquery-1.11.0.js"></script>
    <script type="text/javascript">


        $(function(){
            $("#s1").change(function (){
                let val =  $("#s1").val();
                location.href = "/depositservlet?action=findDepositByCid&cardid="+val;
            })
          /*  $("#s1").onchange(function (){
                //选择完银行卡失去焦点时跳到查询当前银行卡定期
                var a =  $("#s1").value();
                location.href = "/depositservlet?action=findDepositByCid&cardid="+a

            })*/
        })
    </script>
</head>
<body>

<form action="" method="post">
    <input type="hidden" name="action" value="" />
    <h1>定期转活期</h1>
    <label>选择银行卡：</label>
    <c:if test="${empty  cardId}">
        <select id="s1" name="cardid">
            <c:forEach items="${user.userCards}" var="UserCard">
                卡号：<option value="${UserCard.cid}">${UserCard.cid}</option>
            </c:forEach>
        </select>
    </c:if>
    <c:if  test="${ not empty  cardId}">
        <select id="s1" name="cardid">
                卡号：<option value="${cardId}">${cardId}</option>
        </select>
    </c:if>

    <c:if  test="${ not empty  banktable.amountMoney}">
        <span>定期金额：${banktable.amountMoney}</span>
    </c:if>

    <c:if  test="${empty  banktable.amountMoney}">
        <span>定期金额：0</span>
    </c:if>

    <br>
    <label>转出金额：</label>
    <input class="itxt" type="text" placeholder="请输入金额"
           autocomplete="off" tabindex="1" name="amountmoney"/>
    <br>
    <label>选择存期：</label>
    <select name="date">
        <option></option>
    </select>
    <br>
    <input type="submit" value="确定转存">
</form>

</body>
</html>
